import CouponDataPage from "./CouponDataPage.scss";
import { PageHeader, Row, Col,Table, Button } from "antd";
import {useNavigate} from 'react-router-dom'
const routes = [
  {
    path: "index",
    breadcrumbName: "营销管理",
  },
  {
    path: "first",
    breadcrumbName: "优惠券",
  },
  {
    path: "second",
    breadcrumbName: "优惠券数据",
  },
];

const CouponsDataPage = () => {
  //表格设置
  const columns = [
    {
      title: '日期',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '领取人数',
      dataIndex: 'age',
      key: 'age',
    },
    {
      title: '领取张数',
      dataIndex: 'address',
      key: 'address',
    },
    {
      title: '使用人数',
      dataIndex: 'ee',
      key: '2',
    },
    {
      title: '使用张数',
      dataIndex: 'ddd',
      key: '1',
    },
  ];
  const data = [
    {
      key: '1',
      name: 'John Brown',
      age: 32,
      address: 'New York No. 1 Lake Park',
      tags: ['nice', 'developer'],
    },
    {
      key: '2',
      name: 'Jim Green',
      age: 42,
      address: 'London No. 1 Lake Park',
      tags: ['loser'],
    },
    {
      key: '3',
      name: 'Joe Black',
      age: 32,
      address: 'Sidney No. 1 Lake Park',
      tags: ['cool', 'teacher'],
    },
  ];
  const navigate = useNavigate()
  return (
    <div className="CouponDataPage" style={CouponDataPage}>
      <div className="CouponDataHead">
        <PageHeader
          className="site-page-header"
          title="优惠券数据"
          breadcrumb={{
            routes,
          }}
        />
      </div>
      <div className="statistical">
        <Row>
          <Col span={6}>
            <p className="tit">领取张数</p>
            <p className="Num">999</p>
          </Col>
          <Col span={6}>
            <p className="tit">领取人数</p>
            <p className="Num">88</p>
          </Col>
          <Col span={6}>
            <p className="tit">使用张数</p>
            <p className="Num">888</p>
          </Col>
          <Col span={6}>
            <p className="tit">使用人数</p>
            <p className="Num">80</p>
          </Col>
        </Row>
      </div>
      <div className="mainDataPage">
        <h3>优惠券领取/使用报表</h3>
        <Table columns={columns} dataSource={data} />
        <Button onClick={()=>{navigate(-1)}}>返回</Button>
      </div>
    </div>
  );
};

export default CouponsDataPage;
